import http from "@/utils/http2.js";

async function getProductList(data) {
  let res = await http.post("auction-product/api/query", data);
  return res;
}

async function deleteProduct(data) {
  let res = await http.delete("auction-product/api/delete", data);
  return res;
}
// 根据id改变产品的状态
async function ByidStatus(data) {
  let res = await http.post("auction-product/api/product/status", data);
  return res;
}
//根据id更改商品的主图
async function ByIdPicture(data) {
  let res = await http.post("auction-product/api/product/picture", data);
  return res;
}
//根据id查询
async function ByidP(data) {
  let res = await http.post("auction-product/api/product/byIdP", data);
  return res;
}
//获取类别树
async function getClassTree() {
  let res = await http.post("auction-product/api/Classifys");
  return res;
}
//商品修改
async function Pupdate(data) {
  let res = await http.put("auction-product/api/pUpdate", data);
  return res;
}
//商品添加
async function Padd(data) {
  let res = await http.post("auction-product/api/add", data);
  return res;
}

export {
  getProductList,
  deleteProduct,
  ByidStatus,
  ByIdPicture,
  ByidP,
  getClassTree,
  Pupdate,
  Padd
};
